package com.daxia.bumall.model;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * DecorateNote
 */
@Entity
@Table(name = "decoratenote") 
public class DecorateNote extends BaseModel {
	/**
	 * id
	 */
	@Id
	@GeneratedValue
	@Column(name = "id")
    private Long id;
	/**
	 * 列表显示图片
	 */
	@Column(name = "headImage")
    private String headImage;
	/**
	 * 标题
	 */
	@Column(name = "title")
    private String title;
	
	/**
	 * 子标题
	 */
	@Column(name = "subTitle")
	private String subTitle;
	
	/**
	 * 业主手机号
	 */
	@Column(name = "mobile")
    private String mobile;
	/**
	 * 笔记作者
	 */
	@ManyToOne
	@JoinColumn(name = "user_id")
    private User user;
	/**
	 * 设计师
	 */
	@ManyToOne
	@JoinColumn(name = "designer_id")
    private Designer designer;
	/**
	 * 关联的用户，户主
	 */
	@ManyToOne
	@JoinColumn(name = "target_user_id")
    private User target;
	/**
	 * 点击量、查看量
	 */
	@Column(name = "clickCount")
    private Long clickCount;
	/**
	 * 评分
	 */
	@Column(name = "rate")
    private Double rate;
	
	@Column(name = "`show`")
	private Boolean show;

	/**
	 * 创建时间
	 */
	@Column(name = "createTime")
    private Date createTime;
	
	
	@OneToMany(mappedBy="decorateNote", fetch=FetchType.LAZY)  
	private List<DecorateNoteDetail> decorateNoteDetails;
	
	public Long getId() {
    	return id;
    }
	
    public void setId(Long id) {
    	this.id = id;
    }
	
	public String getHeadImage() {
    	return headImage;
    }
	
    public void setHeadImage(String headImage) {
    	this.headImage = headImage;
    }
	
	public String getTitle() {
    	return title;
    }
	
    public void setTitle(String title) {
    	this.title = title;
    }
	

	public String getMobile() {
    	return mobile;
    }
	
    public void setMobile(String mobile) {
    	this.mobile = mobile;
    }
	
	public User getUser() {
    	return user;
    }
	
    public void setUser(User user) {
    	this.user = user;
    }
	
	public Designer getDesigner() {
    	return designer;
    }
	
    public void setDesigner(Designer designer) {
    	this.designer = designer;
    }
	
	public User getTarget() {
    	return target;
    }
	
    public void setTarget(User target) {
    	this.target = target;
    }
	
	public Long getClickCount() {
    	return clickCount;
    }
	
    public void setClickCount(Long clickCount) {
    	this.clickCount = clickCount;
    }
	
	public Double getRate() {
    	return rate;
    }
	
    public void setRate(Double rate) {
    	this.rate = rate;
    }
	
	public Date getCreateTime() {
    	return createTime;
    }
	
    public void setCreateTime(Date createTime) {
    	this.createTime = createTime;
    }

	public Boolean getShow() {
		return show;
	}

	public void setShow(Boolean show) {
		this.show = show;
	}

	public List<DecorateNoteDetail> getDecorateNoteDetails() {
		return decorateNoteDetails;
	}

	public void setDecorateNoteDetails(List<DecorateNoteDetail> decorateNoteDetails) {
		this.decorateNoteDetails = decorateNoteDetails;
	}

	public String getSubTitle() {
		return subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}

	
}
